﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Hallenberg.SmartClient.TypeHandlers;
using Hallenberg.SmartClient.Menu;
using System.Reflection;

namespace Hallenberg.SmartClient.Test.TypeHandlers
{
    [TestFixture]
    public class MenuItemAttributeHandlerTest
    {
        private const string MainMenuCollection = "MainMenu";
        private const string MenuItemName = "MenuName";
        private const string MenuTitle = "The Menu Title";

        [Test]
        public void ShouldBeAbleToCreateMenuItemAttributeHandler()
        {
            var menuManager = new MenuManager();
            var handler = new MenuItemAttributeHandler(menuManager, null);
        }

        [Test]
        public void ShouldBeAbleToHandleMenuItemAttribute()
        {
            var menuManager = new MenuManager();
            var handler = new MenuItemAttributeHandler(menuManager, null);

            var menuItemAttribute = new MenuItemAttribute(MainMenuCollection, MenuItemName, MenuTitle);

            bool result = handler.Handle(this.GetType(), MethodInfo.GetCurrentMethod(), menuItemAttribute, null);

            Assert.That(result, Is.True);
        }
    }
}
